package com.itentbase.match.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itentbase.match.common.utils.GetMatchFrom500Utils;
import com.itentbase.match.mapper.FootballMatchMapper;
import com.itentbase.match.pojo.po.FootballMatch;
import com.itentbase.match.service.FootballMatchService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 足球比赛服务impl
 *
 * @author wjl
 * @date 2024-12-26 14:21:25
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class FootballMatchServiceImpl extends ServiceImpl<FootballMatchMapper,
        FootballMatch> implements FootballMatchService {
    private final FootballMatchMapper mapper;

    /**
     * 选择列表
     *
     * @return {@link List }<{@link FootballMatch }>
     * @author wjl
     * @date 2024-12-26 14:57:38
     **/
    @Override
    public List<FootballMatch> selectList() {
        return mapper.selectLists();
    }


    /**
     * 从500买足球
     *
     * @author wjl
     * @date 2024-12-26 15:02:32
     **/
    public void  getFootballFrom500(){
        List<FootballMatch> footballMatchData = GetMatchFrom500Utils.getFootballMatchData();
        //推荐使用批量存储或者修改数据
        this.saveBatch(footballMatchData);
    }
}
